// import BlankNode from './blank-node'
import ConfirmInfoNode from './confirm-info-node';
import speakWaitingNode from './speak-waiting-node';
import messageCollectNode from './message-collect-node';
// import signContractNode from './sign-contract-node';
import detectLivingFaceNode from './detect-living-face-node';
import faceCompareNode from './face-compare-node';
import sendMessageNode from './send-message-node';
import requestLocationNode from './request-location-node';
import transferNode from './transfer-node';
import scanCodeNode from './scan-code-node';
import hangupNode from './hangup-node';
import businessNavigationNode from './business-navigation-node';
import idCardCompareNode from './id-card-compare-node';
import sendFormNode from './send-form-node';
// import readWaitNode from './waiting-read-node';
import sceneTransferNode from './scene-transfer-node';
// import summaryConfirmNode from './summary-confirm-node';
import silentWatingNode from './silent-wating-node';
import optionJudgeNode from './option-judge-node';
import messageSummary from './message-summary-node';
import sendContentsNode from './send-contents-node';
import nlpNode from './nlp-node';
import soundReceptionNode from './sound-reception-node';
import variableJudgeNode from './variable-judge-node';
import sendDepositionNode from './send-deposition-node';
import sendSignNode from './send-sign-node';
import variableCollection from './variable-collection-node';
import inviteHumanThreeParties from './invite-human-three-parties-node';
import collectShortVideo from './video-collect-node';
import interfaceCall from './interface-call-node';
import startSystemRecordingNode from './start-recording-node';
import stopSystemRecordingNode from './stop-recording-node';
import cardCollectionNode from './card-collection';
import llmNode from './llm-node';
export default class CustomPalette {
	constructor(bpmnFactory, create, elementFactory, palette, translate) {
		this.bpmnFactory = bpmnFactory;
		this.create = create;
		this.elementFactory = elementFactory;
		this.translate = translate;

		palette.registerProvider(this);
	}

	getPaletteEntries(/*element*/) {
		const { bpmnFactory, create, elementFactory } = this;

		function createElement(name) {
			return function (event) {
				const businessObject = bpmnFactory.create('bpmn:Task');
				businessObject['taskId'] = name + '_' + window.aiWorkFlowlId++;
				const shape = elementFactory.createShape({
					type: 'bpmn:Task',
					id: businessObject['taskId'],
					businessObject
				});
				create.start(event, shape);
			};
		}

		return {
			// 'create.blank-node': {
			//     group: 'model',
			//     className: BlankNode.className,
			//     title: BlankNode.title,
			//     action: {
			//         dragstart: createElement(BlankNode.name),
			//         click: createElement(BlankNode.name)
			//     }
			// },
			'create.confirm-info-node': {
				group: 'model',
				className: ConfirmInfoNode.className,
				title: ConfirmInfoNode.title,
				action: {
					dragstart: createElement(ConfirmInfoNode.name),
					click: createElement(ConfirmInfoNode.name)
				}
			},
			'create.sepak-waiting-node': {
				group: 'model',
				className: speakWaitingNode.className,
				title: speakWaitingNode.title,
				action: {
					dragstart: createElement(speakWaitingNode.name),
					click: createElement(speakWaitingNode.name)
				}
			},
			'create.message-collect-node': {
				group: 'model',
				className: messageCollectNode.className,
				title: messageCollectNode.title,
				action: {
					dragstart: createElement(messageCollectNode.name),
					click: createElement(messageCollectNode.name)
				}
			},
			// 2249 合同签署下架
			// 'create.sign-contract-node': {
			// 	group: 'model',
			// 	className: signContractNode.className,
			// 	title: signContractNode.title,
			// 	action: {
			// 		dragstart: createElement(signContractNode.name),
			// 		click: createElement(signContractNode.name)
			// 	}
			// },
			'create.detect-living-face-node': {
				group: 'model',
				className: detectLivingFaceNode.className,
				title: detectLivingFaceNode.title,
				action: {
					dragstart: createElement(detectLivingFaceNode.name),
					click: createElement(detectLivingFaceNode.name)
				}
			},
			'create.face-compare-node': {
				group: 'model',
				className: faceCompareNode.className,
				title: faceCompareNode.title,
				action: {
					dragstart: createElement(faceCompareNode.name),
					click: createElement(faceCompareNode.name)
				}
			},
			'create.send-message-node': {
				group: 'model',
				className: sendMessageNode.className,
				title: sendMessageNode.title,
				action: {
					dragstart: createElement(sendMessageNode.name),
					click: createElement(sendMessageNode.name)
				}
			},
			'create.request-location-node': {
				group: 'model',
				className: requestLocationNode.className,
				title: requestLocationNode.title,
				action: {
					dragstart: createElement(requestLocationNode.name),
					click: createElement(requestLocationNode.name)
				}
			},
			'create.transfer-node': {
				group: 'model',
				className: transferNode.className,
				title: transferNode.title,
				action: {
					dragstart: createElement(transferNode.name),
					click: createElement(transferNode.name)
				}
			},
			'create.scan-code-node': {
				group: 'model',
				className: scanCodeNode.className,
				title: scanCodeNode.title,
				action: {
					dragstart: createElement(scanCodeNode.name),
					click: createElement(scanCodeNode.name)
				}
			},
			'create.business-navigation-node': {
				group: 'model',
				className: businessNavigationNode.className,
				title: businessNavigationNode.title,
				action: {
					dragstart: createElement(businessNavigationNode.name),
					click: createElement(businessNavigationNode.name)
				}
			},
			'create.send-form-node': {
				group: 'model',
				className: sendFormNode.className,
				title: sendFormNode.title,
				action: {
					dragstart: createElement(sendFormNode.name),
					click: createElement(sendFormNode.name)
				}
			},

			'create.id-card-compare-node': {
				group: 'model',
				className: idCardCompareNode.className,
				title: idCardCompareNode.title,
				action: {
					dragstart: createElement(idCardCompareNode.name),
					click: createElement(idCardCompareNode.name)
				}
			},
			// 2022-3-18  1952需求， 欧阳注释查阅等待，汇总确认模板
			// 'create.waiting-read-node': {
			// 	group: 'model',
			// 	className: readWaitNode.className,
			// 	title: readWaitNode.title,
			// 	action: {
			// 		dragstart: createElement(readWaitNode.name),
			// 		click: createElement(readWaitNode.name)
			// 	}
			// },
			'create.scene-transfer-node': {
				//scene-transfer-node
				group: 'model',
				className: sceneTransferNode.className,
				title: sceneTransferNode.title,
				action: {
					dragstart: createElement(sceneTransferNode.name),
					click: createElement(sceneTransferNode.name)
				}
			},
			// 'create.summary-confirm-node': {
			// 	group: 'model',
			// 	className: summaryConfirmNode.className,
			// 	title: summaryConfirmNode.title,
			// 	action: {
			// 		dragstart: createElement(summaryConfirmNode.name),
			// 		click: createElement(summaryConfirmNode.name)
			// 	}
			// },
			'create.silent-wating-node': {
				group: 'model',
				className: silentWatingNode.className,
				title: silentWatingNode.title,
				action: {
					dragstart: createElement(silentWatingNode.name),
					click: createElement(silentWatingNode.name)
				}
			},
			'create.option-judge-node': {
				group: 'model',
				className: optionJudgeNode.className,
				title: optionJudgeNode.title,
				action: {
					dragstart: createElement(optionJudgeNode.name),
					click: createElement(optionJudgeNode.name)
				}
			},

			'create.message-summary-node': {
				group: 'model',
				className: messageSummary.className,
				title: messageSummary.title,
				action: {
					dragstart: createElement(messageSummary.name),
					click: createElement(messageSummary.name)
				}
			},
			'create.send-contents-node': {
				group: 'model',
				className: sendContentsNode.className,
				title: sendContentsNode.title,
				action: {
					dragstart: createElement(sendContentsNode.name),
					click: createElement(sendContentsNode.name)
				}
			},
			'create.nlp-node': {
				group: 'model',
				className: nlpNode.className,
				title: nlpNode.title,
				action: {
					dragstart: createElement(nlpNode.name),
					click: createElement(nlpNode.name)
				}
			},
			'create.sound-reception-node': {
				group: 'model',
				className: soundReceptionNode.className,
				title: soundReceptionNode.title,
				action: {
					dragstart: createElement(soundReceptionNode.name),
					click: createElement(soundReceptionNode.name)
				}
			},
			'create.variable-judge-node': {
				group: 'model',
				className: variableJudgeNode.className,
				title: variableJudgeNode.title,
				action: {
					dragstart: createElement(variableJudgeNode.name),
					click: createElement(variableJudgeNode.name)
				}
			},
			'create.send-deposition-node': {
				group: 'model',
				className: sendDepositionNode.className,
				title: sendDepositionNode.title,
				action: {
					dragstart: createElement(sendDepositionNode.name),
					click: createElement(sendDepositionNode.name)
				}
			},
			'create.send-sign-node': {
				group: 'model',
				className: sendSignNode.className,
				title: sendSignNode.title,
				action: {
					dragstart: createElement(sendSignNode.name),
					click: createElement(sendSignNode.name)
				}
			},
			'create.variable-collection-node': {
				group: 'model',
				className: variableCollection.className,
				title: variableCollection.title,
				action: {
					dragstart: createElement(variableCollection.name),
					click: createElement(variableCollection.name)
				}
			},
			'create.invite-human-three-parties-node': {
				group: 'model',
				className: inviteHumanThreeParties.className,
				title: inviteHumanThreeParties.title,
				action: {
					dragstart: createElement(inviteHumanThreeParties.name),
					click: createElement(inviteHumanThreeParties.name)
				}
			},
			'create.video-collect-node': {
				group: 'model',
				className: collectShortVideo.className,
				title: collectShortVideo.title,
				action: {
					dragstart: createElement(collectShortVideo.name),
					click: createElement(collectShortVideo.name)
				}
			},
			'create.interface-call-node': {
				group: 'model',
				className: interfaceCall.className,
				title: interfaceCall.title,
				action: {
					dragstart: createElement(interfaceCall.name),
					click: createElement(interfaceCall.name)
				}
			},

			// Todo 结束模板要放在最后面 后续模板都往 hangup-node 前面加
			'create.hangup-node': {
				group: 'model',
				className: hangupNode.className,
				title: hangupNode.title,
				action: {
					dragstart: createElement(hangupNode.name),
					click: createElement(hangupNode.name)
				}
			},
			'create.start-recording-node': {
				group: 'model',
				className: startSystemRecordingNode.className,
				title: startSystemRecordingNode.title,
				action: {
					dragstart: createElement(startSystemRecordingNode.name),
					click: createElement(startSystemRecordingNode.name)
				}
			},
			'create.stop-recording-node': {
				group: 'model',
				className: stopSystemRecordingNode.className,
				title: stopSystemRecordingNode.title,
				action: {
					dragstart: createElement(stopSystemRecordingNode.name),
					click: createElement(stopSystemRecordingNode.name)
				}
			},
			'create.card-collection-node': {
				group: 'model',
				className: cardCollectionNode.className,
				title: cardCollectionNode.title,
				action: {
					dragstart: createElement(cardCollectionNode.name),
					click: createElement(cardCollectionNode.name)
				}
			},
			'create.llm-node': {
				group: 'model',
				className: llmNode.className,
				title: llmNode.title,
				action: {
					dragstart: createElement(llmNode.name),
					click: createElement(llmNode.name)
				}
			}
		};
	}
}

CustomPalette.$inject = ['bpmnFactory', 'create', 'elementFactory', 'palette', 'translate'];
